#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int n = 0, num = 0;
    int arr1[32] = { 0 };
    int arr2[4] = { 0 };
    for (int f = 0; f < 32; f++)
    {
        scanf("%d", &n);
        arr1[f] = n;
    }
    for (int i = 0; i < 32; i++)
    {
        if ((i + 1) % 8 == 0)
        {
            int c = 128;
            for (int t = num * 8; t < (num + 1) * 8; t++)
            {
                if (arr1[t] == 1)
                {
                    arr2[num] += c;
                }
                c /= 2;
            }
            num++;
        }
    }
    printf("%d.%d.%d.%d", arr2[0], arr2[1], arr2[2], arr2[3]);
    return 0;
}